
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
instance-stringer
Advanced tools
Converts a content of a class instance to a string.
To install from npm:
$ npm i instance-stringer --save
For Node.js
const instanceStringer = require('instance-stringer')
const { propsStringer, arrayStringer } = instanceStringer
For Web browser (only supporting es6):
<script src="instance-stringer.min.js"></script>
<script>
const { propsStringer, arrayStringer } = instanceStringer
</script>
Converts content of the instance of MyClass
:
class SubClass {
constructor() {
this.p = 1
this.q = 2
}
}
class MyClass {
constructor() {
this.a = 123
this.b = { c: 'A', d: [{ g: 1, h: 2 }, 3], e: new SubClass() }
}
}
const myInstance = new MyClass()
instanceStringer(myInstance)
// => "MyClass { a: 123, b: { c: 'A', d: [{ g: 1, h: 2 }, 3], e: SubClass { p: 1, q: 2 } } }"
propsStringer(myInstance)
// => "{ a: 123, b: { c: 'A', d: [{ g: 1, h: 2 }, 3], e: SubClass { p: 1, q: 2 } } }"
arrayStringer(myInstance.b.d)
// => "[{ g: 1, h: 2 }, 3]"
Converts content of class instance to a string with its class name.
If the instance is a plain object its class name (Object
) is not output.
Converts properties of a plain object or a class instance to a string without its class name.
Converts elements of an array to a string.
Copyright (C) 2017-2018 Takayuki sato
This program is free software under MIT License. See the file LICENSE in this distribution for more details.
FAQs
Convert content of a class instance to a string.
The npm package instance-stringer receives a total of 294 weekly downloads. As such, instance-stringer popularity was classified as not popular.
We found that instance-stringer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.